<template>
  <div class="dark_table">
    <div class="give_table_title">
      <span style="margin-right: 16px">设备报警统计</span>
    </div>
    <div class="flex-x flex-space" style="padding: 0 20px">
      <dv-border-box-7 style="width: 32%">
        <div style="padding: 20px 0 10px 0" class="flex-y flex-center">
          <div>工艺越限报警数</div>
          <dv-digital-flop
            :config="warmalarmCount('upLimitalarmCount')"
            style="width: 200px; height: 40px"
          />
        </div>
      </dv-border-box-7>
      <dv-border-box-7 style="width: 32%">
        <div style="padding: 20px 0 10px 0" class="flex-y flex-center">
          <div>设备故障报警数</div>
          <dv-digital-flop
            :config="warmalarmCount('deviceWarmalarmCount')"
            style="width: 200px; height: 40px"
          />
        </div>
      </dv-border-box-7>
      <dv-border-box-7 style="width: 32%">
        <div style="padding: 20px 0 10px 0" class="flex-y flex-center">
          <div>通讯故障报警数</div>
          <dv-digital-flop
            :config="warmalarmCount('comWarmalarmCount')"
            style="width: 200px; height: 40px"
          />
        </div>
      </dv-border-box-7>
    </div>
  </div>
</template>

<script>
import _ from "lodash";
export default {
  props: {
    alarmStatInfoList: {
      type: Array,
      default: () => [],
    },
  },
  computed: {
    // 设备告警数
    warmalarmCount() {
      return function (key) {
        if (this.alarmStatInfoList.length) {
          return {
            number: [_.sumBy(this.alarmStatInfoList, key)],
            // content: "{nt}个",
          };
        } else {
          return {
            number: [0],
            // content: "{nt}个",
          };
        }
      };
    },
  },
  data() {
    return {
      config1: {
        number: [100],
        // content: "{nt}个",
      },
    };
  },
};
</script>

<style lang="scss" scoped>
.give_table_title {
  padding: 20px;
}
</style>